#!/usr/bin/python
# -*- coding: utf-8 -*-
# encoding: utf-8
# 通用结构体

import util.ExchangeConst

class Ticker:

    def __init__(self, Info, High, Low, Sell, Buy, Last, Volume):
        self.Info = Info
        self.High = High
        self.Low = Low
        self.Sell = Sell
        self.Buy = Buy
        self.Last = Last
        self.Volume = Volume


class Depth:

    def __init__(self, Asks, Bids):
        self.Asks = Asks
        self.Bids = Bids


class DepthValue:

    def __init__(self, Price, Amount):
        self.Price = Price
        self.Amount = Amount


class Trade:

    def __init__(self, Id, Time, Price, Amount, Type):
        self.Id = Id
        self.Time = Time
        self.Price = Price
        self.Amount = Amount
        self.Type = Type

class Record:

    def __init__(self, Time, Open, High, Low, Close, Volume):
        self.Time = Time
        self.Open = Open
        self.High = High
        self.Low = Low
        self.Close = Close
        self.Volume = Volume

class Order:

    def __init__(self, Info, Id, Price, Amount, DealAmount, AvgPrice, Status, Type):
        self.Info = Info
        self.Id = Id
        self.Price = Price
        self.Amount = Amount
        self.DealAmount = DealAmount
        self.AvgPrice = AvgPrice
        self.Status = Status
        self.Type = Type


class Account:


    '''

        "accountAlias": "SgsR",    // 账户唯一识别码
        "asset": "USDT",        // 资产
        "balance": "122607.35137903",   // 总余额
        "crossWalletBalance": "23.72469206", // 全仓余额
        "crossUnPnl": "0.00000000"  // 全仓持仓未实现盈亏
        "availableBalance": "23.72469206",       // 下单可用余额
        "maxWithdrawAmount": "23.72469206",     // 最大可转出余额
        "marginAvailable": true,    // 是否可用作联合保证金
        "updateTime": 1617939110373
    '''

    def __init__(self, Info, Balance, FrozenBalance, Stocks, FrozenStocks):
        self.Info = Info
        self.Balance = float(Balance)
        self.FrozenBalance = FrozenBalance
        self.Stocks = Stocks
        self.FrozenStocks = FrozenStocks

class Position:

    def __init__(self, Info, MarginLevel, Amount, CanCover, FrozenAmount, Price, Profit, Type, ContractType,symbol=None):
        self.Info = Info
        self.MarginLevel = MarginLevel
        self.Amount = Amount
        self.CanCover = CanCover
        self.FrozenAmount = FrozenAmount
        self.Price = Price
        self.Profit = Profit
        self.Type = Type
        self.ContractType = ContractType
        self.Symbol = symbol

